/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trunk.view.MenuClicDroit;

import trunk.model.Dessin;
import trunk.model.PaintModel;
import trunk.observer.Observer;

/**
 *
 * @author Bu2spencer
 */
public class MenuClicDroit extends MenuClicDroitView implements Observer{
    private MenuClicDroitCtrl ctrl;
    private PaintModel paintModel;


    public MenuClicDroit(){
        super();
    }
    
    public MenuClicDroit(PaintModel model){
        super();
        this.paintModel=model;
        setMenuClicDroitCtrl( new MenuClicDroitCtrl(this) );
        deselect.setEnabled(paintModel.isSelect());
        symetrieO.setEnabled(paintModel.isSelect());
        symetrieX.setEnabled(paintModel.isSelect());
        symetrieY.setEnabled(paintModel.isSelect());
        clone.setEnabled(paintModel.isSelect());
        group.setEnabled(paintModel.isSelect());
        degroup.setEnabled(paintModel.isSelect());
        delete.setEnabled(paintModel.isSelect());
    }

    @Override
    public void update(Dessin dessin) {
        deselect.setEnabled(paintModel.isSelect());
        symetrieO.setEnabled(paintModel.isSelect());
        symetrieX.setEnabled(paintModel.isSelect());
        symetrieY.setEnabled(paintModel.isSelect());
        clone.setEnabled(paintModel.isSelect());
        group.setEnabled(paintModel.isSelect());
        degroup.setEnabled(paintModel.isSelect());
        delete.setEnabled(paintModel.isSelect());
        
    }

    public PaintModel getPaintModel() {
        return paintModel;
    }
    
}